import axios from 'axios'
import { notification } from 'ant-design-vue'
const service = axios.create({
  baseURL: process.env.VUE_APP_BASE_API,
  timeout: 10 * 1000
})
service.interceptors.request.use(
  config => {
    return config
  },
  error => {
    return Promise.reject(error)
  }
)
service.interceptors.response.use(
  response => {
    return response.data
  },
  error => {
    notification.error({
      message: '系统提示',
      description: error.response.data.message,
      duration: 4
    })
  }
)
export default service
